import java.util.Arrays;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2023-10-14
 * Time：21:57
 */
public class work {
    public static int binarySearch(int[] arr, int key) {
        int left = 0;
        int right = arr.length-1;
        while(left <= right) {
            int mid = (left + right) >>> 1;
            if(arr[mid] == key) {
                return mid;
            } else if (arr[mid] < key) {
                left = mid + 1;
            } else {
                right = mid -1;
            }
        }
        return -1;
    }
    public static void judgeSort(int[] arr) {
        int flg = 0;
        for (int i = 0; i < arr.length - 1; i++) {
            if(arr[i] > arr[i + 1])
            {
                flg = 1;
            }
        }
        if (flg == 0)
        {
            System.out.println("有序");
        } else {
            System.out.println("无序");
        }
    }
    public static void bubbleSort(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++) {
            int flg = 0;
            for (int j = 0; j < arr.length-1-i; j++) {
                if(arr[j] > arr[j + 1]){
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                    flg = 1;
                }
            }
            if(flg == 0) {
                break;
            }
        }
    }
    public static int findOnce(int[] arr) {
        int ret = 0;
        for (int i = 0; i < arr.length; i++) {
            ret ^= arr[i];
        }
        return ret;
    }
    public static void main(String[] args) {
        int[] arr = {11,11,22,22,33};
        int[] arr2 = {11,22,44,44,55,66};
        int[] arr3 = {11,22,44,33,55,66};
        /*System.out.println(binarySearch(arr, 33));
        System.out.println(binarySearch(arr, 55));
        System.out.println(binarySearch(arr, 11));
        System.out.println(binarySearch(arr, 32));*/

        /*judgeSort(arr);
        judgeSort(arr2);
        judgeSort(arr3);*/

        /*int[] array = {12,31,24,88,22,13};
        bubbleSort(array);
        System.out.println(Arrays.toString(array));*/

        System.out.println(findOnce(arr));
    }
}
